

<%@page import="com.ykwep.web.server.data.Page"%>		
<%@page import="javax.jdo.PersistenceManager"%>
<%@page import="com.ykwep.web.server.PMF"%>
<%@page import="com.ykwep.web.server.data.NewsItem"%>
<%@page import="java.util.List"%>		
<jsp:include page="/header.jsp" />		
		
		
		<%
		Long newsItemId = new Long(request.getParameter("page_id"));
		PersistenceManager pm = PMF.get().getPersistenceManager();
		Page i = pm.getObjectById(Page.class, newsItemId);
		%>
		<h2>Update Page</h2>
	<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
	<script src="/ckeditor/_samples/sample.js" type="text/javascript"></script>
	
	
	<form action="/admin/update_page" method="post">
	  <div>Title:<br/> <input name="title" value="<%=i.getTitle() %>"></input></div>
      <div>Name:<br/> <input name="name" value="<%=i.getName() %>"></input></div>
	  <div>Publish:<br/> <input name="published" type="checkbox" <%=(i.getPublished() ? "checked" :"")%>></input></div>
     
      <div>Content:<br/> <textarea cols="75" id="editor1" name="content" rows="20"><%=PMF.makeXMLSafe(i.getContent()) %></textarea></div>
      		<script type="text/javascript">
				//<![CDATA[

					// This call can be placed at any point after the
					// <textarea>, or inside a <head><script> in a
					// window.onload event handler.

					// Replace the <textarea id="editor"> with an CKEditor
					// instance, using default configurations.
					CKEDITOR.replace( 'editor1' );

				//]]>
				</script>
      
      <div><input type="hidden" name="page_id" value="<%=i.getId() %>"><input type="submit" value="Update Page" /></div>
    </form>
    <%		pm.close(); %>
		

				
<jsp:include page="/footer.jsp" />
				